test(db): gate replica routing in CI - #4596
Conversation
Signed-off-by: Tal Weiss <major.tal@gmail.com>
a364ca2 to
e795553
Compare
|
Ran the acceptance criteria from #3622 locally against this branch (Postgres 17.10 in Docker, pinned Acceptance criteria1. Both named fixtures run ✅ — the 2. "A revert of only the #3268 production fix fails CI" ✅ — this is the one the PR body didn't cover, so I ran it. Removing only the One failure, and the right one — the other four stay green because the mutation doesn't touch what they cover. The gate discriminates rather than merely running. Mutation reverted; nothing in this branch changed. 3. No selection of the usage-metrics lock test ✅ — 0 of 5. Also worth noting for anyone re-reading #3622's Constraint 1: #3619 closed on 2026-07-30, so the ordering dependency is already satisfied. The coverage question
Overall the gate selects 5 of 154 ignored I want to be fair about this: #3622 also says "initially cover the exact routing matrix verified by hand in #3268," and this PR scopes itself to that matrix. If those five are the matrix, this is correct as scoped and the rest is follow-up work. I couldn't confirm it either way — #3268's body doesn't enumerate the matrix — so this is a question, not a defect claim. One thing I'd suggest regardless. #3622 asks for "a comment stating it must cover every
That guarantees nothing extraneous is in the module, but not that every routing fixture is in it — so a future routing fixture written outside Happy to do either here if you'd like — I have the environment set up and can re-run the revert check against a widened selection. |
Summary
Sorry for the noisy nesting diff. Moving these existing fixtures into a dedicated module adds indentation, but it gives Nextest an explicit, auditable selector that cannot silently miss oddly named routing tests.
tests::replica_routingThis turns the hand-verified replica-routing invariants into a CI gate before
BUZZ_REPLICA_READ_MAX_AGE_MSis enabled.Related issue
Fixes #3622
Testing
buzz-dbCI-profile archive with the pinnedcargo-nextest 0.9.136, then ran the exact proposed archived command: 5 passed, 242 skippedTEST_DATABASE_URL=postgres://buzz:buzz_dev@localhost:5432/buzz cargo test -p buzz-db --lib 'tests::replica_routing::' -- --ignored --test-threads=1: 5 passedcargo test -p buzz-db --lib -- --test-threads=1: 94 passed, 153 ignoredcargo clippy -p buzz-db --lib --tests -- -D warningscargo fmt -p buzz-db -- --check